home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-08-12 | 9.3 KB | 239 lines | [TEXT/MPS ] |
- # Note: This Makefile is included in the MPW package because it demonstrates many
- # of the features of Make.
- #
- #
- # Apple Macintosh Developer Technical Support
- #
- # MultiFinder-Aware SoundApp Application
- #
- # SoundApp
- #
- # SoundApp.make - Make Source
- #
- # Copyright © 1989-1990 Apple Computer, Inc.
- # All rights reserved.
- #
- # Versions:
- # 1.03 May, 1990
- # 1.04 Sept, 1990
- # 1.1b1 Nov, 1990 MPW 3.2 update
- #
- # Components:
- # SoundApp.make May 1, 1990 MPW build script
- # SoundApp.p May 1, 1990 Pascal source code
- # SoundApp.r May 1, 1990 Rez source code
- # SoundAppSnds.r May 1, 1990 Rez source code
- # SoundUnit.p May 1, 1990 Pascal source code
- #
- # Formatting was done with FONT = Monaco, SIZE = 9, TABS = 3
- #
- # SoundApp.p is a sample application source file for demonstrating
- # the Sound Manager. It requires the use of the SoundUnit to handle
- # all of the sound routines. This portion of the source code handles the
- # application’s management of memory, errors, user interface, etc..
- #
- # Jim Reekes E.O., Macintosh Developer Technical Support
- # Tuesday, January 30, 1990 1:01 PM
- #
-
-
-
- AppName = PSoundApp
- Signature = 'SAPP'
-
- #------------------------------------------------------------------------------
- # Location of our utility files. The double “:” means “two levels above the
- # current folder”. Hopefully, this will also be the location of our
- # utilities folder. If not, then change the following line:
- #------------------------------------------------------------------------------
-
- UtilityFolder = ::Utilities:
-
-
- #------------------------------------------------------------------------------
- # Options for our compilers:
- # -sym on: tells the compilers and linker to emit symbol information for
- # a source level debugger, such as SADE.
- # -i {UtilityFolder}: means to look for any USES files in the specified
- # directory, as well as the normal set.
- # -mbg off: tells the compilers to not emit low-level debugger names. This
- # saves on file space, but you may wish to remove this option if you
- # need to debug with something like Macsbug.
- # -rd: for Rez means to suppress warnings for redeclared types (we redeclare
- # 'RECT' because it’s not included in MPW 3.0).
- # -append: means to add the resources to the target file, rather than
- # deleting all the ones that are there first.
- # -d Signature...: is a way of passing our application's signature to Rez.
- # With this mechanism, we can define our signature here, and export
- # it to Rez, so that we don't have to declare it there, too.
- # -sn PASLIB=Main: puts all the routines that would normally go into the
- # PASLIB segment into the Main segment. This is done so that when we
- # call upon any low-level utilities, we don't potentially move memory
- # by loading in a segment.
- #------------------------------------------------------------------------------
- # The Rez templates have changed from MPW 3.0/3.1 to MPW 3.2 (or will change,
- # depending on when you read this). Our .r file has conditional statements
- # that will cause the right things to happen. This is all controlled by the
- # dummy target ShellForce.
- #------------------------------------------------------------------------------
-
- SymOptions = -sym off # turn this on to debug with SADE
- IncludesFolders = -i {UtilityFolder}
- AOptions = -d qDebug=0 {IncludesFolders}
- POptions = {IncludesFolders} {SymOptions} -mbg full
- RezOptions = -rd -append {IncludesFolders} -d Signature="{Signature}" -d AppName='{AppName}'
- LinkOptions = {SymOptions} {SegmentMappings}
- SegmentMappings = -sn INTENV=Main ∂
- -sn PASLIB=Main ∂
- -sn STDCLIB=Main ∂
- -sn SANELib=Main ∂
- -sn UtilMain=Main ∂
- -sn MAFailureRes=Main ∂
- -sn Offscreen=Main ∂
- -sn UtilInit=Initialization
-
-
- #------------------------------------------------------------------------------
- # These are modified default build rules. This is necessary to take into
- # account differences between MPW 3.1 and 3.2
- #------------------------------------------------------------------------------
- .p.o ƒ .p
- {Pascal} {POptions} {PAltOptions} {DepDir}{Default}.p -o {TargDir}{Default}.p.o
-
- .c.o ƒ .c
- {C} {COptions} {CAltOptions} {DepDir}{Default}.c -o {TargDir}{Default}.c.o
-
- #------------------------------------------------------------------------------
- # These are the objects that we want to link with. If any one of these
- # changes, then we invoke the Link command.
- #------------------------------------------------------------------------------
-
- AppObjects = ∂
- "{UtilityFolder}Utilities.p.o" ∂
- SoundUnit.p.o ∂
- SoundApp.p.o
-
-
- #------------------------------------------------------------------------------
- # Which files we link with depends on whether we are running MPW 3.1 or 3.2
- # Under MPW 3.2 and later, “CInterface.o” and “CRuntime.o” are merged with
- # “Interface.o” and “Runtime.o”. The appropriate choice will be made
- # dynamically before compiling and linking occurs. See ShellForce below.
- #
- # Be sure GestaltGlue.a.o is before Interface.o in PLibs and CLibs below.
- #------------------------------------------------------------------------------
- PLibs = ∂
- "{Libraries}Runtime.o" ∂
- "{UtilityFolder}"GestaltGlue.a.o ∂
- "{Libraries}Interface.o" ∂
- "{Libraries}"ToolLibs.o ∂
- "{PLibraries}"SANELib.o ∂
- "{PLibraries}PasLib.o"
-
- PLibs32 = ∂
- "{Libraries}Runtime.o" ∂
- "{Libraries}Interface.o" ∂
- "{Libraries}"ToolLibs.o ∂
- "{PLibraries}"SANELib.o ∂
- "{PLibraries}PasLib.o"
-
- CLibs = ∂
- "{CLibraries}CRuntime.o" ∂
- "{CLibraries}CInterface.o" ∂
- "{Libraries}"ToolLibs.o ∂
- "{UtilityFolder}"GestaltGlue.a.o ∂
- "{Libraries}Interface.o"
-
- CLibs32 = ∂
- "{CLibraries}StdCLib.o" ∂
- "{Libraries}Runtime.o" ∂
- "{Libraries}"ToolLibs.o ∂
- "{Libraries}Interface.o"
-
- #------------------------------------------------------------------------------
- # Generic Utilities dependencies - This standard set is pasted in whenever
- # we make use of the Utilities routines. It's quite probable that we don't
- # need all of these dependencies for this build, but any extra ones are
- # ignored.
- #------------------------------------------------------------------------------
-
- UtilityRezFiles = {UtilityFolder}Utilities.r ∂
- {UtilityFolder}UtilitiesCommon.h
-
- UtilityHeaderFiles = {UtilityFolder}Utilities.h ∂
- {UtilityFolder}UtilitiesCommon.h
-
- UtilityInterfaceFiles = {UtilityFolder}Utilities.p
-
- {UtilityFolder}Utilities.p.o ƒ {UtilityFolder}Utilities.inc1.p
-
- {UtilityFolder}Utilities.c.o ƒ {UtilityFolder}Utilities.h ∂
- {UtilityFolder}UtilitiesCommon.h
-
- #------------------------------------------------------------------------------
- # Dependencies for the individual components. These will invoke the
- # default build rules as described in Chapter 9 of the MPW 3.0 manual.
- #------------------------------------------------------------------------------
-
- SoundApp.p.o ƒ {AppName}.make SoundUnit.p {UtilityInterfaceFiles}
-
- SoundUnit.p.o ƒ {AppName}.make
-
-
- #------------------------------------------------------------------------------
- # This is a dummy dependency rule. This will always be executed. This dummy
- # rule must be the first for {AppName} so that it will be executed first.
- # This is necessary to make evaluations that are beyond the scope of
- # Make. These evaluations will be performed by the Shell at execution time,
- # and they must execute first because compile and link command lines depend
- # on variables set up by these evaluations. This has the unfortunate side
- # effect that Make will always consider {AppName} to be out of date. It will
- # always, at a minimum, execute the commands for the target ShellForce.
- #------------------------------------------------------------------------------
-
- {AppName} ƒƒ ShellForce
-
- # With the above rule, {AppName} will always be out of date with respect to
- # the non-existent file ShellForce. This will force the following commands to
- # be executed.
- ShellForce ƒ
- BEGIN
- IF "{ShellVersion}" == ""
- ( EVALUATE "`Version`" =~ /MPW Shell≈ ([0-9]+(.[ab0-9]+)+)®1≈/ ) ∑ Dev:Null
- SET ShellVersion "{®1}"
- END
- IF "{ShellVersion}" =~ /3.[01]≈/
- SET PAltOptions "-d MPW32=FALSE"
- SET CAltOptions "-d MPW31"
- SET RezAltOptions "-d MPW31"
- SET PSysObjects "`QUOTE {PLibs}`"
- SET CSysObjects "`QUOTE {CLibs}`"
- ELSE
- SET PAltOptions "-d MPW32=TRUE"
- SET CAltOptions "-d MPW32"
- SET RezAltOptions "-d MPW32"
- SET PSysObjects "`QUOTE {PLibs32}`"
- SET CSysObjects "`QUOTE {CLibs32}`"
- END
- END ∑ Dev:Null # Output to bit bucket so we don’t see above calculations
-
- #------------------------------------------------------------------------------
- # Build rule that links our application together. If any of our objects
- # changes, or this makefile changes, then we relink.
- #------------------------------------------------------------------------------
-
- {AppName} ƒƒ {AppObjects}
- Link {LinkOptions} -o {Targ} {AppObjects} {PSysObjects}
- SetFile {Targ} -t APPL -c {Signature} -a B
-
- #------------------------------------------------------------------------------
- # Build rule that creates our resources and adds them to the application
- #------------------------------------------------------------------------------
-
- {AppName} ƒƒ SoundAppSnds.r {AppName}.make
- Rez {RezOptions} {RezAltOptions} -o {Targ} SoundAppSnds.r
-
- {AppName} ƒƒ SoundApp.r {AppName}.make
- Rez {RezOptions} {RezAltOptions} -o {Targ} SoundApp.r
-
-